package com.mrtan.mapper;

import com.mrtan.bean.Customer;
import com.mrtan.vo.CustomerVO;
import com.mrtan.vo.CustomerWhereVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author Mr.Tan
 * @description 针对表【customer(客户)】的数据库操作Mapper
 * @createDate 2023-12-04 11:12:04
 * @Entity com.mrtan.bean.Customer
 */
public interface CustomerMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(Customer record);

    int insertSelective(CustomerVO CustomerVO);

    Customer selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(CustomerVO CustomerVO);

    int updateByPrimaryKey(Customer record);

    List<Customer> selectAll(CustomerWhereVO customerWhereVO);

    Customer selectBy(CustomerWhereVO customerWhereVO);

    List<String> selectNames();

    Customer selectByEmail(String email);

    int  selectOrderCount(String customerName);

    List<Map<Customer,Integer>> getCustomerOrderSum(Integer month);

    List<Map<String, Object>> selectTotalAmountByCustomerAndTime(Integer month);

    List<Map<String, Object>> selectTotalorderByCustomerTime();

    Customer selectByName(@Param("name") String name);



}
